


        var originalScrollTop,consultScrollTop;
        var atTop = false;
        var mobileMenuMoving = null;
        var mobileMenuInview = false;
        var originalWindowWidth,consultWindowWidth;
        //延迟跳转
        var linkJumpCount = 1.5;
        var linkHref;
        function countDown(){
            linkJumpCount -= 0.5;
           
            //linkJumpCount=0时，跳转页面
            if(linkJumpCount <= 0){
                location.href = linkHref;
            }

            //每秒执行一次,phoneTime()
            setTimeout("countDown()",1000);
        }
        //禁止手指滑动页面
        function bodyScroll(event) {
            　event.preventDefault();
        }
        //内容高度是否小于屏幕高度
        function checkContnHeight(){
            if($('.container')[0].offsetHeight < window.innerHeight){
                $('.container').addClass('fillAll');
            }
        }
        
        //判断是否为移动设备
        function browserRedirect(){
            var sUserAgent = navigator.userAgent.toLowerCase();
            var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
            var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
            var bIsMidp = sUserAgent.match(/midp/i) == "midp";
            var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
            var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
            var bIsAndroid = sUserAgent.match(/android/i) == "android";
            var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
            var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
            if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
                $('body').addClass('mobileDevice');
            }
        }
        
        //延迟动画
        var beginningDelay = null;
        var animateDelayCount = 150;

        $(document).ready(function(){
            consultScrollTop = originalScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
            consultWindowWidth = originalWindowWidth = window.innerWidth;
            for(var a = 0;a < $('header .menu .pc a').length;a++){
                var href = $('header .menu .pc a')[a].href;
                console.log(href);
                if(window.location.href.indexOf(href) >= 0){
                    $('header .menu .pc a:eq(' + a + ')').addClass('current');
                    break;
                }else if(window.location.href.indexOf('news') >= 0 && href.indexOf('news') >= 0){
                    $('header .menu .pc a:eq(' + a + ')').addClass('current');
                    break;
                }
            }
            //链接延迟跳转
            /*$('a').click(function(e){
                //return false;
                linkHref = $(this).attr('href');
                 var ae = e || window.event;
                 if(ae.preventDefault){ // w3c
                     $('body>.container').addClass('transparent');
                     $('.loading').css('opacity','1');
                     countDown();
                     ae.preventDefault();
                 } else { // ie
                     $('body>.container').addClass('transparent');
                     $('.loading').css('opacity','1');
                     countDown();
                     ae.returnValue = false;
                 }
            })*/
            console.log(window.performance.navigation.type);
            //判断设备类型
            browserRedirect();
            setTimeout(checkContnHeight,10);
            $('.menu .mobileMenuBtn').click(function(){
                if($('html')[0].className.indexOf('overHidden') < 0){
                    $('html').addClass('overHidden');
                    $('.menu').addClass('phone');
                    if($('body')[0].className.indexOf('mobileDevice') >= 0){
                        document.body.addEventListener("touchmove", bodyScroll, {passive:false});
                    }else{
                        $('body').addClass('noScroll');
                    }
                }else{
                    $('html').removeClass('overHidden');
                    $('.menu').removeClass('phone');
                    if($('body')[0].className.indexOf('mobileDevice') >= 0){
                        document.body.removeEventListener('touchmove', bodyScroll, { passive: false });
                    }else{
                        $('body').removeClass('noScroll');
                    }
                }
            });
            if(originalScrollTop > 0){
                $('header').addClass('shadow');
            }
            $(window).scroll(function(){
                console.log('c');
                consultScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                if(consultScrollTop > 0 && $('header')[0].className.indexOf('shadow') < 0){
                    $('header').addClass('shadow');
                }else if(consultScrollTop == 0 && $('header')[0].className.indexOf('shadow') >= 0){
                    $('header').removeClass('shadow');
                }
            })
        })